<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Map</title>
<style type="text/css">
* {
	margin: 0;
	padding: 0;
}
body {
	background-image: url(images/send_shopping.png);
}
#news_content {
	height: 690px;
	width: 800px;
	position: absolute;
	left: 50px;
	top: 30px;	
}
.button {
    border: 1px solid #006;
    background: #FE9A2E;
}
</style>
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script type="text/javascript">
var ajaxSubmit = function(formEl) {
	if ($("#name").val() == '' || $("#telephone").val() == '' || $("#address").val() == '' || $("#email").val() == '' || $("#content").val() == '' ){
		alert("กรุณากรอกข้อมูลให้ครบ");
	} else {
		var url = $(formEl).attr('action');
		var data = $(formEl).serialize();
		$.ajax({
			type: "post",
			url: url,
			data: data,
			datatype: 'html',
			success: function(data){
                                if(data == ""){
                                    alert("ส่งเมล์สำเร็จ !!");
                                    window.close();
                                }else{
                                    alert(data);
                                }
			}    
		})
	}
	return false;
}
</script>
</head>

<body>
	<div id="news_content">

	<div id="error" style="color:#ff0000"></div>
	<form id="profileForm" type="actionForm" action="sendmail.php" method="post" onSubmit="return ajaxSubmit(this)">
		<table cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td><span style="font-size:large;text-decoration:underline">สั่งซื้อสินค้าออนไลน์</span></td>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
			</tr>			
			<tr>
                <td class="label"style="width:250px;"><label for="name">ชื่อผู้ส่ง</label></td>
                <td class="field">
					<textarea id="name" name="name" rows="2" style="overflow:hidden;width:500px" tabindex="1"></textarea>
                </td>
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
			</tr>			
			<tr>
                <td class="label"><label for="telephone">เบอร์โทรศัพท์</label></td>
                <td class="field">
					<textarea id="telephone" name="telephone" rows="2" style="overflow:hidden;width:500px" tabindex="1"></textarea>
                </td>
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
			</tr>			
			<tr>
                <td class="label"><label for="address">ที่อยู่</label></td>
                <td class="field">
					<textarea id="address" name="address" rows="2" style="overflow:hidden;width:500px" tabindex="1"></textarea>
                </td>
			</tr>			
			<tr>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
			</tr>			
			<tr>
                <td class="label"><label for="email">Email สำหรับติดต่อกลับ</label></td>
                <td class="field">
					<textarea id="email" name="email" rows="2" style="overflow:hidden;width:500px" tabindex="1"></textarea>
                </td>
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
			</tr>			
			<tr>
                <td class="label"><label for="content">อาหารที่ต้องการสั่งซื้อ</label></td>
                <td class="field">
					<textarea id="content" name="content" rows="15" style="overflow:hidden;width:500px" tabindex="1"></textarea>
                </td>
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
			</tr>
            <tr>
				<td></td>
				<td>
					<div>
						<span></span>
						<input type="submit" value="ส่ง" class="button" style="width: 100px" tabindex="14" />&nbsp;&nbsp;&nbsp;
						<input type="button" value="ยกเลิก" class="button" style="width: 100px" tabindex="15" onClick="window.close();" />
					</div>
				</td>
			</tr>			
		</table>
	</form>


	</div>
</body>
</html>
